home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
8614
/
8614.xpi
/
modules
/
ClientInfo.jsm
Wrap
Text File
|
2010-02-10
|
1KB
|
44 lines
// DO NOT import this into the global namespace, but instead
// import it into your own namespace wrapper
var EXPORTED_SYMBOLS = ["CLIENT_INFO"];
Components.utils.import("resource://glydo/utils/prototype_xul_1_6_0_3_modified.jsm");
Components.utils.import("resource://glydo/utils/io.jsm");
Components.utils.import("resource://glydo/utils/Utils.jsm");
const MY_APP_ID = "{363c6421-6d58-11dd-876c-001f3a388e21}";
var CLIENT_INFO = ({
init: function(appId) {
this.appId = appId;
this.version = Utils.extensionVersion(appId);
this.initClientID();
},
initClientID: function() {
var file = DirIO.get("ProfD");
file.append("glydo");
DirIO.create(file);
file.append("clientid");
if (FileIO.create(file)) {
this.clientId = Utils.uuid1();
if (!FileIO.write(file,this.clientId)) {
throw "Can't store client ID into file";
}
} else {
// File already exists, load id
this.clientId = FileIO.read(file);
if (this.clientId === false) {
throw "Can't read client ID from file";
}
}
},
});
CLIENT_INFO.init(MY_APP_ID);